#pragma once
#include <assert.h>

enum Type
{
	COUNT, POUNTERDIV, RECURSION
};

size_t my_strlen(const char* str,Type type = COUNT)
{
	assert(str);
	if (type == COUNT)
	{
		size_t count = 0;
		while (*str != '\0')
		{
			str++;
			count++;
		}
		return count;
	}
	else if (type == POUNTERDIV)
	{
		const char* base = str;
		while (*str != '\0')
		{
			str++;
		}
		return str - base;
	}
	else
	{
		if (*str != '\0')
		{
			return 1 + my_strlen(++str, RECURSION);
		}
		else
			return 0;
	}
}